package com.wyt.lzzy;

import java.util.ArrayList;

public class Array_work {

    public static void main(String[] args) throws Exception {
        ArrayList<Student> stu = new ArrayList();
        Student r1 = new Student(1,"xiaotao",20);
        Student r2 = new Student(2,"xiaozhang",19);
        Student r3 = new Student(3,"xiaochen",22);
        stu.add(r1);
        stu.add(r2);
        stu.add(r3);

        show(stu);
        System.out.println("---------------");
//        删除
        stu.remove(r1);
        show(stu);
    }

    public static void show(ArrayList arr) {
        for (Object one : arr){
            System.out.println(one.toString());
        }
    }
}
